import http from "./http.ts";

interface IUser {
    id:string,
    email:string,
    password:string, 
    code?:number,
    message?:string,
    age?:Number,
    data?:any
}

export const getUser = () => {
    return http.get("/auth/get")
}

export const getUsers = (params:any) => {
    return http.get<IUser>("/auth/searchUser",{params});
}
export const handleSendEmail = (params:any) => {
    return http.post(`/auth/send-code`,params)
}
export const handleChangePassword = (params:any) => {
    return http.post(`/auth/changePassword`,params)
}

// 邮箱注册
export const handleAddUser = (params:any) => {
    return http.post<IUser>("/auth/register",params)
}
//用户注册
export const handleAddUser1 = (params:any) => {
    return http.post('/auth/registerUser',params)
}
export const handleYanZhengCode = (params:any) => {
    return http.post('/auth/verify-code',params)
}

export const handleLogin = (params:any) => {
    return http.get('/auth/login',{params})
}

export const handleSendPhone = (params:any) => {
    return http.post('/auth/sendMsg',params)
}

export  const handleYZ = (params:any) => {
    return http.post('/auth/verifyCode',params)
}

export const handleFace = (params:any) => {
    return http.post('/auth/registerFace',params)
}